
#if 01
#ifndef _THREAD_POOL_H__
#define _THREAD_POOL_H__



#ifdef __cplusplus
extern "C" {
#endif
// #define DEBUG
#ifdef DEBUG
#define LOG(fmt, ...) fprintf(stdout, "[%s:%d]: "fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#else
#define LOG(fmt, ...)
#endif
typedef struct threadpool_s threadpool_t;
typedef void (*handler_ptr)(void *);
threadpool_t *threadpool_create(int thread_count);
void threadpool_terminate(threadpool_t *pool);
int threadpool_commit(threadpool_t *pool, handler_ptr func, void *arg);
void threadpool_waitdone(threadpool_t *pool);

#ifdef __cplusplus
}
#endif

#endif // _THREAD_POOL_H__
#endif